package com.sg.business.commons.field.validator;

import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.forms.IMessageManager;

import com.mobnut.db.model.PrimaryObject;
import com.sg.business.model.DummyModel;
import com.sg.widgets.commons.valuevalidator.IFieldInputValidator;
import com.sg.widgets.registry.config.FieldConfigurator;

public class DeliveryRequireValidator implements IFieldInputValidator {

	public DeliveryRequireValidator() {
	}

	@Override
	public boolean validate(PrimaryObject data,
			FieldConfigurator fieldConfigurator, Object valueForUpdate,
			IMessageManager messageManager, Control control) {
		if("".equals(valueForUpdate)) {
			data.setValue(DummyModel.DELIVERY_REQUIRE, "");
		}
		return true;
	}
}
